package main.java.chessfootball.rules.checker;

import main.java.chessfootball.model.exception.RuleViolationException;
import main.java.chessfootball.model.game.Game;

/**
 * User: Igor
 * Date: 12.06.2011
 * Time: 7:44:17
 */
public abstract class AbstractChecker
{
	protected Game game;

	public Game getGame()
	{
		return game;
	}

	public void setGame(Game game)
	{
		this.game = game;
	}

	public abstract boolean valid();

	public void check() throws RuleViolationException
	{
		if (!valid())
		{
			throw new RuleViolationException(this.getClass());	
		}
	}
}
